<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改申请记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-society-verify" th:object="${recordSociety}">
            <h4 class="form-header h4">申请记录信息</h4>
            <input name="societyId" th:field="*{societyId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">人员类型：</label>
                <div class="form-control-static" th:if="*{userType == '01'}">
                    普通职工
                </div>
                <div class="form-control-static" th:if="*{userType == '02'}">
                    中层及以上
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">专业：</label>
                <div class="form-control-static" th:text="*{major}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">参加学会、协会名称：</label>
                <div class="form-control-static" th:text="*{societyTitle}">
                </div>
            </div>
            <div class="form-group select-time">
                <label class="col-sm-3 control-label is-required">开始时间：</label>
                <div class="form-control-static" th:text="*{startTime}">
                </div>
            </div>
            <div class="form-group select-time">
                <label class="col-sm-3 control-label is-required">结束时间：</label>
                <div class="form-control-static" th:text="*{endTime}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="form-control-static" th:text="*{remark}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">人事科意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="humanFlag" value="1" th:field="*{humanFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="humanFlag" value="2" th:field="*{humanFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="humanOpinion" name="humanOpinion" class="form-control" th:field="*{humanOpinion}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">人事科分管领导意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="humanLeaderFlag" value="1" th:field="*{humanLeaderFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="humanLeaderFlag" value="2" th:field="*{humanLeaderFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="humanLeaderOpinion" name="humanLeaderOpinion" class="form-control" th:field="*{humanLeaderOpinion}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">医务科（护理部）意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="medicalFlag" value="1" th:field="*{medicalFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="medicalFlag" value="2" th:field="*{medicalFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="medicalOpinion" name="medicalOpinion" class="form-control" th:field="*{medicalOpinion}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">医务科（护理部）分管领导意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="medicalLeaderFlag" value="1" th:field="*{medicalLeaderFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="medicalLeaderFlag" value="2" th:field="*{medicalLeaderFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="medicalLeaderOpinion" name="medicalLeaderOpinion" class="form-control" th:field="*{medicalLeaderOpinion}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">科教科意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="scienceFlag" value="1" th:field="*{scienceFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="scienceFlag" value="2" th:field="*{scienceFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="scienceOpinion" name="scienceOpinion" class="form-control" th:field="*{scienceOpinion}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">科教科分管领导意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="scienceLeaderFlag" value="1" th:field="*{scienceLeaderFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="scienceLeaderFlag" value="2" th:field="*{scienceLeaderFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="scienceLeaderOpinion" name="scienceLeaderOpinion" class="form-control" th:field="*{scienceLeaderOpinion}" type="text">
                </div>
            </div>
            <div class="form-group" th:if="*{userType == '02'}">
                <label class="col-sm-3 control-label">党委书记意见：</label>
                <div class="col-sm-4">
                    <div class="radio-box">
                        <input type="radio" name="partyFlag" value="1" th:field="*{partyFlag}">
                        <label>同意</label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="partyFlag" value="2" th:field="*{partyFlag}">
                        <label>不同意</label>
                    </div>
                </div>
                <div class="col-sm-4">
                    <input id="partyOpinion" name="partyOpinion" class="form-control" th:field="*{partyOpinion}" type="text">
                </div>
            </div>
            <h4 class="form-header h4">申请内容信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "record/society/verify";
        $("#form-society-verify").validate({
            focusCleanup: true
        });

        var verifyType = [[${verifyType}]];

        $(function(){
            $('input[name="humanFlag"]').attr('disabled', "disabled");
            $("#humanOpinion").attr("disabled","disabled");
            $('input[name="humanLeaderFlag"]').attr('disabled', "disabled");
            $("#humanLeaderOpinion").attr("disabled","disabled");
            $('input[name="medicalFlag"]').attr('disabled', "disabled");
            $("#medicalOpinion").attr("disabled","disabled");
            $('input[name="medicalLeaderFlag"]').attr('disabled', "disabled");
            $("#medicalLeaderOpinion").attr("disabled","disabled");
            $('input[name="scienceFlag"]').attr('disabled', "disabled");
            $("#scienceOpinion").attr("disabled","disabled");
            $('input[name="scienceLeaderFlag"]').attr('disabled', "disabled");
            $("#scienceLeaderOpinion").attr("disabled","disabled");
            $('input[name="partyFlag"]').attr('disabled', "disabled");
            $("#partyOpinion").attr("disabled","disabled");
            if(verifyType == 'human') {
                $('input[name="humanFlag"]').removeAttr('disabled');
                $("#humanOpinion").removeAttr("disabled");
            } else if(verifyType == 'humanLeader') {
                $('input[name="humanLeaderFlag"]').removeAttr('disabled');
                $("#humanLeaderOpinion").removeAttr("disabled");
            } else if(verifyType == 'medical') {
                $('input[name="medicalFlag"]').removeAttr('disabled');
                $("#medicalOpinion").removeAttr("disabled");
            } else if(verifyType == 'medicalLeader') {
                $('input[name="medicalLeaderFlag"]').removeAttr('disabled');
                $("#medicalLeaderOpinion").removeAttr("disabled");
            } else if(verifyType == 'science') {
                $('input[name="scienceFlag"]').removeAttr('disabled');
                $("#scienceOpinion").removeAttr("disabled");
            } else if(verifyType == 'scienceLeader') {
                $('input[name="scienceLeaderFlag"]').removeAttr('disabled');
                $("#scienceLeaderOpinion").removeAttr("disabled");
            } else if(verifyType == 'party') {
                $('input[name="partyFlag"]').removeAttr('disabled');
                $("#partyOpinion").removeAttr("disabled");
            }
        })

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/save", $('#form-society-verify').serialize());
            }
        }

        $(function() {
            var options = {
                data: [[${recordSociety.recordSocietyContentList}]],
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [
                {
                    field: 'title',
                    align: 'center',
                    title: '已参加学会、协会名称'
				},
                {
                    field: 'startDate',
                    align: 'center',
                    title: '开始时间'
				},
                {
                    field: 'endDate',
                    align: 'center',
                    title: '结束时间'
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>